# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer:  Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=perl-mime-tools
_realname=MIME-tools
pkgver=5.510
pkgrel=0
pkgdesc="Perl modules for parsing (and creating!) MIME entities"
url="http://search.cpan.org/~doneill/MIME-tools-$pkgver/"
arch="noarch"
license="PerlArtistic GPL"
depends="perl perl-io-stringy perl-mailtools perl-convert-binhex"
checkdepends="perl-test-deep perl-test-pod"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/D/DS/DSKOLL/$_realname-$pkgver.tar.gz"
builddir="$srcdir/$_realname-$pkgver"

prepare() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor || return 1
}

build() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make || return 1
}

package() {
	make DESTDIR="$pkgdir" install
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

check() {
	make test
}

sha512sums="
86d110cc3ed3e9744a07a7b671df713708ab70f57aea858a9570bd021102b4cea91a869239f6c40611f1b1fae190e1b6d1bd65b54914ffc3a41fdf9160977328  MIME-tools-5.510.tar.gz
"
